﻿@model S4Store.Models.Inventory.CarBrandInventoryModel
@{
    Layout = null;
    ViewBag.Title = "CarBrandInventory";
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="margin:20px; text-align:center">库存总数：@Model.Total &nbsp;&nbsp;&nbsp; 总库存系数：@Model.TotalXs.toInt()</div>
 <table  style="border-collapse:collapse; width:100%" class="reporttable vmiddle">
 
 <tr>
  <th rowspan="2">车型</th>
  <th rowspan="2">车款</th>
  <th rowspan="2">月初库存</th>
  <th rowspan="2">上月交车</th>
  <th rowspan="2">上月库存系数</th>
  <th colspan="6">库存</th>
  <th colspan="3">交车</th>
  <th rowspan="2">库存系数</th>
  <th rowspan="2">库存系数动态</th>
 </tr>
 <tr>
  <th>A类</th>
  <th>B类</th>
  <th>C类</th>
  <th>C类最高库龄</th>
  <th>在途</th>
  <th>合计</th>
  <th>二网</th>
  <th>本店</th>
  <th>合计</th>
 </tr>
   @for (var i = 0; i < Model.Reports.Count;i++ )
   {
       var r = Model.Reports[i];
 <tr>
    @if(i==0){
   <td rowspan="@Model.Reports.Count">@Model.CarBrand.Name</td>
   }
    <td>@r.CarModel.Name</td>
    <td>@r.LastMonthInventory</td>
    <td>@r.LastMonthGiveCar</td>
    <td>@r.LastMonthInventoryCoefficient.toRound(1)</td>    
    <td>@r.AKC</td>     
    <td>@r.BKC</td>     
    <td>@r.CKC</td>    
    <td>@r.CKL</td>     
    <td>@r.ZT</td>        
    <td>@r.Inventory</td>      
    <td>@r.BDYJ</td>
    <td>@r.EWYJ</td> 
    <td>@r.GiveCarCount</td>
    <td  @S4Store.Utils.GetBgColor(r.InventoryCoefficient <= 1)>@r.InventoryCoefficient.toInt()</td>
    <td  @S4Store.Utils.GetBgColor(r.InventoryCoefficientDiff >= 0)>@r.InventoryCoefficientDiff.toInt()</td>
 </tr>
   }
    <tr>
   <td colspan="2">合计</td>
    <td>@Model.BrandReport.LastMonthInventory</td>
    <td>@Model.BrandReport.LastMonthGiveCar</td>
    <td>@Model.BrandReport.LastMonthInventoryCoefficient.toRound(1)</td>    
    <td>@Model.BrandReport.AKC</td>     
    <td>@Model.BrandReport.BKC</td>     
    <td>@Model.BrandReport.CKC</td>    
    <td>@Model.BrandReport.CKL</td>     
    <td>@Model.BrandReport.ZT</td>        
    <td>@Model.BrandReport.Inventory</td>      
    <td>@Model.BrandReport.BDYJ</td>
    <td>@Model.BrandReport.EWYJ</td> 
    <td>@Model.BrandReport.GiveCarCount</td>
    <td  @S4Store.Utils.GetBgColor(Model.BrandReport.InventoryCoefficient <= 1)>@Model.BrandReport.InventoryCoefficient.toInt()</td>
    <td  @S4Store.Utils.GetBgColor(Model.BrandReport.InventoryCoefficientDiff >= 0)>@Model.BrandReport.InventoryCoefficientDiff.toInt()</td>
 </tr>
 </table>
</div>

